<template>
  <base-breadcrumb>
    <a-spin :spinning="loading">
      <a-card :bordered="false">
        <!-- <a-tabs v-model="defActiveKey">
          <template v-for="(item) in tabData">
            <a-tab-pane :key="item.id"
              :tab="item.name+ '责任书'"
              v-if="item.show"
            > -->
              <tab-table
                :tab="item"
              ></tab-table>
            <!-- </a-tab-pane>
          </template>
        </a-tabs> -->
      </a-card>
    </a-spin>
  </base-breadcrumb>
</template>

<script>
import { Empty } from 'ant-design-vue' // 无数据提示
import tabTable from './tabTable.vue'
import { typesLabelList } from '@/api/science'
export default {
  name:'a'+ Date.now(),
  components: {
    tabTable,
    Empty
  },
  computed: {
    activeName() {
      return (this.$route.query.isCom == false || this.$route.query.isCom == 'false') ? '项目' : '分公司'
    }
  },
  data() {
    return {
      loading: false,
      defActiveKey: '',
      tabData: [],
    }
  },
  mounted() {
    let that = this
    this.loading = true
    typesLabelList({type: 4}).then((res) => {
      this.loading = false
      if (res.code == 200) {
        let list = res.data.map((item, index) => {
          if (item.name.includes('分公司')) {
            item.show = this.$btnPermission('stm_010_bc_01')
          } else {
            item.show = this.$btnPermission('stm_010_pd_02')
          }
          return item
        })
        const com = list.filter((e) => {
          return e.show
        })
        this.defActiveKey = com.length ? com[0].id : ''
        this.tabData = list//res.data
      }
    }).catch(() => {
      this.loading = false
    })
  },
  methods: {
  },
}
</script>

